#ifndef FPLAYER_DEVICE_H
#define FPLAYER_DEVICE_H

#include "MediaDefine.h"

//枚举 采集类型
enum DeviceType {
  DeviceType_Audio = 0,        //音频
  DeviceType_Camera,           //本地相机
  DeviceType_MP4,              //MP4的媒体类型
  DeviceType_RTMP,             //RTMP的媒体类型
  DeviceType_RTSP,             //RTSP的媒体类型
};

//枚举 采集状态
enum DeviceState {
  DeviceState_None = 0,
  DeviceState_Init,            //初始化完成状态
  DeviceState_Start,           //开始采集状态
  DeviceState_Stop,            //停止采集状态
};

//结构体 设备
typedef struct ST_Device : public IBasic {
  int32_t devID = INVALID_ID;                 //设备ID
  DeviceType devType = DeviceType_Audio;      //设备类型
  DeviceState devState = DeviceState_None;    //设备状态
} IDevice;


//结构体 相机设备
typedef struct ST_CameraDevice : public ST_Device {
  int32_t width = 0;                          //宽
  int32_t height = 0;                         //高
  int32_t frameRate = 0;                      //帧率

  const char *getClassName() override {
    return "CameraDevice";
  }

  void toString() override {
    LOG_TEST("CameraDevice(devID:%d, devState:%d, devType:%d, width:%d,height:%d,frameRate:%d)",
             devID, devState, devType, width, height, frameRate)
  }
} CameraDevice;


//结构体 网络设备
typedef struct ST_IPCameraDevice : public ST_Device {
  char stStream[128];                         //流地址
  bool isSoftDecode = false;                  //解码模式 false:硬解 true:软解

  const char *getClassName() override {
    return "IPCameraDevice";
  }

  void toString() override {
    LOG_TEST("IPCameraDevice(devID:%d, devState:%d, devType:%d, stStream:%s)",
             devID, devState, devType, stStream)
  }
} IPCameraDevice;


//结构体 音频设备
typedef struct ST_AudioDevice : public ST_Device {
  int32_t sampleRate = 0;
  int32_t samplesBitPer = 0;
  int32_t channelNum = 0;

  const char *getClassName() override {
    return "AudioDevice";
  }

  void toString() override {
    LOG_TEST(
        "AudioDevice(devID:%d, devState:%d, devType:%d, sampleRate:%d, samplesBitPer:%d, channelNum:%d)",
        devID, devState, devType, sampleRate, samplesBitPer, channelNum)
  }
} AudioDevice;

#endif //FPLAYER_DEVICE_H
